Improve consistency of error handling and messaging