Improved error handling when loading assemblies.