Quote paths to handle base folder with spaces. Fixes #926

That's part of it, and some unrelated issues remain