Fixing some js issues