Fix tests, add tests for affiliation