Cleaned up error reporting