Restore proper maxrows calculation