Fix checking exception message.