fix: handle leak. Cleanup empty dirs.