Fixed tests to work with PhantomJS