Essays on systemic risk