Fix signed/unsigned mismatch.
Fix the remaining /W4 C4510 and C4610 warnings.
int to CHAR
Fix the /W4 C4701 warnings: using potentially uninitialized local variable.