Fix issue 9172
feature #10829 Fix issue 9172 (umpirsky)

This PR was squashed before being merged into the 2.3-dev branch (closes #10829).

Discussion
----------

Fix issue 9172

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9172
| License       | MIT

Commits
-------

25f1d85 Fix issue 9172