fix amd64 portability issues