Fix some issues found by code inspector
Merge pull request #389 from owncloud/scrut

Fix some issues found by code inspector