Adding dump_state() to display internal state. Verified that all regs are correctly reset.