import from: http://oflute.googlecode.com/svn/trunk/ r299