Three essays on systemic risk