Correct undo error

Replace incorrect path.SplitList() usage.
Add test to catch such errors.