organise set options, fix persistent undo