issue #18917: two bugfixes
Merge pull request #918 from shackbarth/18917

issue #18917: two bugfixes