Fix some issues in appUtils.js