Miscellaneous improvements

@SLaks, when changing the build type to `Release`, Code Analysis is throwing more warnings.