Code analysis warnings fixed