fix improper update of RemoteEndPoint state
Fix tests