YUI: compatibility changes

Clone of #260