Fixed js errors

These changes address http://bugs.jqueryui.com/ticket/7498