Fixing some incompatibility changes with latest jquery