Undo Fix

Fix the undo behaviour to work on the current stack.