Fixed some tests not working under mocha-phantomjs