Removing process z indices.
Properly setting surface when attaching/detaching layers to the surface.