various fixes for a succesful migration