Slightly improved error handling and feedback.