Small JS bugfix & JSHinted all JS
Fixes some validation errors