Bug 12508: adding an error message if a contract cannot be removed