fix a few gm bugs