Small fixes
Reimplemented transmitter as state machine