Fixing more JS errors