Merged from mwolson@gnu.org--2005 (patch 279, 311, 318)