Fixing VC++ warnings and errors.