Fix bug with group serialization to disk
(cherry picked from commit b60aec8)