Make tests work in PhantomJS