convert from NId to FamilyId instead of FamilyId to NId

should be equivalent for comparison purposes

Change-Id: I45ed21ee3b45425b5e1ca39e0774c6d34cd2ee76
MAXROWCOUNT-1 -> MAXROW, same number but tidier

Change-Id: I710365e8e44923c320203f749da84323ffa3d063