Essays in open-economy macroeconomics