jshint fixes
Fix incorrect function calls
Fix select fields.
Should eventually refactor this as its likely to cause issues