Fix a bug in util.js