Correctly mark deleted directories as deleted