Undo functionality set up etc. Fixes, improvements.