Improvements on error messages