Backports of potentially useful fixes