Fix x86 release & x64 compile problems