Work around a bug on jQuery 1.9.1 and 2.0