fixes util.js to pass unit tests
Merge pull request #536 from bitwit/chore-fix-util-tests

fixes util.js to pass unit tests