Fixed delete bugs