ported from ~devel/beta.
paul