Fixed static analyzer warnings