Fix inventory/connection race condition.