All socket handling now async and minor bug fixes