Minor changes in order to support new jQuery