Fixed some visual studio code analysis warnings