Fixed a bug in displaying error messages.