Minor improvements to PPU code