Fix check for empty records.