Improved error handling for object loader.