Replace unnecessary bad code with abstractness (coverity-52108)
Correct if statement (coverity-52107)