Backports from mer-packages and upstream