Corrected subscripting. Logs grid to stderr.