Fixed regex used to clean up bad working directories