Fixes for change from Prototype to jQuery