Implement undo function
Minor UI fixes