Improved exception display
Added checks and fallbacks to ensure that enumeration-related database inconsistencies do not cause problems