Bugs during initialization with newer versions of jquery and jqueryui

Hi!

I noticed a bug during initialization while using newer versions of jquery and jqueryui.
I managed to fix some tests, but still one fails.

I hope you could take advantage of my changes and eventually improve this version.

Thanks!

Bye,
  Xc