Fix some logically dead code which was found by Coverity.