Cleaned up socket handling.
Fix's some accept encoding things