Fixing bugs found with Visual Studio Code Analysis