Fix compatibility with jQuery < 1.8. Closes #643.

Workaroud for this jQuery issue: http://bugs.jquery.com/ticket/11231