small fixes in util.js