Add unit tests to verify that "undelete" works; fix so it does