Change the way PKs for through table are handled (Closes #1117)

Same as #1294, just with less clutter