Implement #1963: Clean working dir with optional path argument

implement #1963