Issue #2130469 by jastraat: Cleanup some JS syntax errors that breaks IE8 and other browsers