Adds some fixes to support x86, amd64 and h8000 together.