Removed unnecessary calls to self and fixed undo