Call jQuery safely

Fixes #330