initial round of amd64 fixes