Bug fixes to the loader.