Essays On Macroeconomics With Heterogeneity And Public Finance