Fix problem with port collisions in Socket