mocha tests fixes