Fixes some broken AMD setup and removes undefined variable references.