Fixed small issues and improved error reporting for imports.