Some improvements to error reporting messages