Escape spaces in folder name so script won't fail

If the current directory has spaces, the script fails to change paths and fails.
Merge pull request #1706 from keyvez/master

Fixes Issue#1705