Bugfix - index can be -ve. Fixes problem with undo/redo leading to ever increasingly...