fix debug output for empty records