Fix all static analysis problems in utils.js