Backport/prs 414 417 422

Backports for three PRs:

* #414
* #417
* #422