Tidied up and improved socket handling
Allowed dialog boxes to show above the client mask.