fixes to getRelated utility and (OMG!) a test case!