Capital flows, volatility, and sovereign debt