Definitions created by Ctrl+G / Ctrl+Alt+G aren't cleaned up by Undo

Hi,
the subject pretty much explains the bug/missing feature request.

Undo only removes the node that got placed by Ctrl+G in the application, the definition that just got created remains in the definition patch.