Fixed loose type cast in 64bit architecture