Fixed some threading issues with netcode.