Fixes to mode button handling and shift register imitation.