Bug fixes and adding support for newer versions of YUI