Fix layer order being incorrect on layer creation.