Fixing modulo so rows work correctly.