Remove directories properly.