issue #617 by JrgenGNielsen: Fixed jQuery bug