Issue #106: fix caching with paths with spaces.

Harden the code: if regular URL creation fails for any reason, do not attempt to create a file URL.

Still small cleanup