I Imported more of Michele Bini's fixes.