Port changes from CVS HEAD

Port changes from CVS HEAD.