Wrote 2 simple testcases
Fixed minor bugs of not closing sockets