Fix for running tests with PhantomJS