Tweaks to allow for phantomjs testing.