Wrote test for and fixed BasicSocket