Fixed JS error on certain operations with jQuery 1.10. Closes #1881.