fix 64-bit bugs reported by sw
fix 64-bit bugs reported by sw,but not test in details