Fix 'unused parameter' warnings on windows
Fix potentially uninitialized variable warnings
Fix unreachable code warning