corrections related to undo functionality

- undo states were double stored when using arrow keys
- buttons would not be disabled when undo/redo history was empty