[NGRINDER-694] Clean up several klocwork bugs