Fix some corner cases with IN constraints on associations