Fixes beatfactor/nightwatch#168

This resolves the problems with Selenium Server 2.42.0, and also works on 2.41.0 (tested locally)