Fix to avoid writing over groups