Fix group ownership on files.

At some point, I think in cdb6d6b, files stopped getting their group ownership set to the value of the group parameter and would have it set to nil/undef instead.

I've fixed this and added a test for it.