Added generic function to check object refs in tables with _refs