Fix location serialization so undo stack works