Update test logic

Update test logic and bug in undo and sort chrono fix