Fix incorrect error messages.