Three essays on the economics of immigration