Fixing AMD loader code