Minor bug-fix when generating code from phantomjs