Finish up getting undo working with state operations. For #305