Make unit tests pass in PhantomJS and older Node versions.