Fix layer manipulation.