Fix two issues found by static analysis
Merge pull request #1143 from HairyFotr/patch-sca

Fix two issues found by static analysis