Fixes a few places where spaces in app path cause trouble.

Can you share the exception stack when space causes issue with this?