Improve command line and unit-tests compatibility with phantomjs and nodejs.