Socket issues fixes and tidy up

Closes #2
Minor release 0.1.0