Update tests to run properly on PhantomJS