Fix AMD support. Tested with both builds, optimised and unoptimised.