Fix JS errors introduced in c1470aaeb47e229f1d66fdbfadf1811f0a51b2f8