Fixed a bug. Added some JQuery extensions.