Spruce up error handling