Clean up utils.js to avoid variable issues
Merge pull request #855 from mc10/minor-fixes

Clean up utils.js to avoid variable issues