Tests for correct handling of zero-length groups

See issue #341.