Fix self-reference test and impl for checking on FK value, not parent PK value
fix test checking for null instead of default(int) value