small fixes in utils.js