Fixed a mistake when autoloading dependent layers.