#1393 - move where types are being assigned so we are guaranteed to have grid.rows