Backport of #8183 to stable6
Backport of #8197 to stable6
Merge pull request #8323 from owncloud/stable5-backport-8183-and-co

Backport of #8183 and #8197