Correct static analysis warnings