Fix deltree and rmtree