fix and clean up regs (based on datasheet)