fixed patch and re-added lost hunk which caused broken paths for cachedir, logfile...