Fix array check for empty rows