Fixed some small issues in the controller.js