Merge additional changes from upstream

This brings two important fixes, c7a8b70 and bbd4a8f, plus the MER specific 91a63f4.