Fixed some 64-bit issues