Fix bug preventing errors being written to STDOUT when a record is invalid