Corrected bug with empty rows