parser tweaks, socket handling fixes