more fixes for generic relations. fixed tests