Fix bug to allow non-multiple row numbers for different screen sizes work properly.