Fixed Contract Deletion Issues

No longer deletes unselected contracts. Also does not crash when a
contract is actually deleted.