index, foreign key fixes