Fix bugs in migrtation to jQuery 1.9