Fixes #4020: Move r30047 to 1.7

---svn-pre-commit-ignore-below---

r30047 [[BR]]
This might explain the current difficulties with the mapping...
Fixes #4021: Move r30048 to 1.7

---svn-pre-commit-ignore-below---

r30048 [[BR]]
Code cleanup while chasing valgrind complaints.