Added more detailed error messages.