Fix some errors in the loader when trying to run the database migration method. Hopefully this won't bite us in the arse.