Replaced weirdo mod-based loops with more sane ones in solver.inl, which also fixes non-cube grid crashes in RAW mode