Updated to work with AMD loaders.