Fix for issue #3, fixed a bug where server sockets were not being tidied
up