Various fixes for logging and chown/chgrp

Nothing major, please, see commit messages. This __needs__ proper testing!