Port from CVS UserCode