Fixed some errors with mocha testing