Avoid negative z-indices.
Do nothing on invalid `Layer.set` calls.