Fix AMD build and tests.