Essays on Macroeconomics with Financial Frictions