Fix getReferencesToContactTable to ignore non-id references