Fixing issue with bad JQuery function calls.