Fix logging of validation errors; add utility method for occasional housekeeping.