Submitted by hansfriese, also found by KingNFT
After removing the contract, the contracts array would contain the wrong contract names.
Repository._removeContract() removes the contract name from contracts array.
But it uses the already changed index(= 0) and replaces the last name with 0 index all the time.
As a result, the contracts array will still contain the removed name and remove the valid name at index 0.
We should use the original index like below.
0xScotch (Malt) confirmed
