Port to the newest version of dg.