Port that stuff to the newest dg version.