Fixed two bugs found by Static Analyzer in previous commit.