Mocha improvements

This PR will try to fix the issues mentioned in #391