Fix JS errors

see #211