fixed the compilation issues on x64 and coding style