add changes to maintain perms and owner of logfile
fix test failures on windows