Fix errors in controller found by JSHint
Fix errors found by JSHint
Changed function statements to function expressions