Fixed command output on windows.
Nicer common prefix detection for tar.gz files.