fix amd error when setting globals.
Merge pull request #68 from patrickarlt/master

Fixes but with setting globals.