Fix AMD loading for files with globals