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

Fixes but with setting globals.
Merge remote-tracking branch 'upstream/master'
add intersects