Foreign key fixes for pwiz, fixes #426