Fixing container removal logic.