Fixed issue #31

Undoing an add function now properly decrements ID counter