Cleaned up error reporting code