Fixes and change to jQuery