s/_handle_receive_state/set_state in tests too