Fixed some coverity findings about dead code, fixed a misleading comment