Essays on repurchase agreements, bailouts, and the macroeconomics effects of bank failures