Fixed bug in the relay and rev protocol