Loader related fixes and cleanups