Fix directory deleting