Bug fix on displaying of error messages