Three Essays On Credit Markets And The Macroeconomy