Fix self-reference test and impl for checking on FK value, not parent PK value