AMD support issues in #478

Fixes issues in #478