Fix CPU bugs found by armwrestler
Fix off-by-one in scanline batching