Fixed static analysis warnings
(closes #3829)