Repaired a minor bug on error messages