Fix the manipulation of surface/layer