Fixed 64bit issues