Fix location problem for undo/redo