Sorted out an issue with PhantomJS 1.9.7. See the changed files for details.