Merged from mwolson@gnu.org--2005 (patch 20-22)