Fixed bug in RX code