Fix some JS errors