Made Grp threadsafe by synchronizing chain computation.