Adding more sophisticated error messages