Fixed some JS errors