Fix JS errors