backport bugfixes from current master

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
Merge remote-tracking branch 'origin/0.9.31.1'