Fixed several minor defects (Coverty detector)