Cleaned up error handling