Fix socket creation; re-order functions
Sync re-order changes. Make parallel easier.