Fix bugs with network command exchange