Fixes a bug in DGS