D1 Merge: bugfixes for 9982, 10211, 10252, 10551, and 19858

All five are identical to the corresponding D2 pull requests.