Mp 1.12 fixes

These commits  could fix https://gna.org/bugs/index.php?23036 and https://gna.org/bugs/?22968

all commits are untested and made with github web interface.