Various fixes from Fedora

If there is a reproducer for a particular patch, it's in the Red Hat bugzilla (see RH-Bugzilla field).