Fixed some js issues