Fixes to last commit
Fixed bug in instances where broken instances were not cleaned