Fixed 64 bit issues