Avoid losing the active layer
Fix step when layers are changed