Fix an issue with changing forms in declarative items.

Any existing cursors are now properly deleted when a form is changed.