Some fixes for new jQuery versions