Fixed content type and improved error message.