fixes and better handling of log file perms