Fix writing to RCNT crashing the emulator