Essays On Macroeconomic Models With Nominal Rigidities And Imperfections In The Goods And Credit Markets