Fix issue #359
Hi, this patch ought to fix issue #359.
Mentioned also in https://bugs.gentoo.org/882805
Adapted from the attached patch in that bug.
The first part of the issue ought to have been addressed by the previous commit (87a5e531), while the second part is addressed by this one.
Edited by ppw 0