Controls on capital inflows ans external shocks (Policy research working paper, 2007)