Added missing socket closes