Port changes from CVS HEAD.