Minor changes on loop.js