Fix some static analysis problems in demo-utils.js