Fixed two issues found by static analysis