Copying stuff from 1.4 to here