Make sure right layers are selected on undo/redo