Improve consistency of error messages