Fix most 64 bit issues