fix up some foreign keys