Fixed Issue #572 (and other js hint warnings)