4-space indent and fixed more bugs

- fix windows bug with folders that end in dots
- cache destination in same folder as script (if permissions allow),
not current directory