Fix component add/change and delete dialogs

This seems a bit fragile, we are relying on the order that we do things in the code, which has a good chance of changing. Any ideas on how we could avoid this stub?