Fix bbtrack undo/redo bug

Fix #790