Some corrections to handle new versions of jquery