Variable for cwd adds unnecessary complexity, removing…
Added step to strip leading './' from the path argument
Switching to extended regex
Cleaned up spelling mistake
This step is unnecessary

'./' is harmless.
removed now useless comment