Fix bug with logging large errors.