Made the error messages more explanatory