Fix disconnect error.
Moved testing to mocha.