Fixed JS errors