Fix bug in import error reporting