Capital Flows, Beliefs, and Capital Controls