fix some bugs in vc8 64bit compiler