FELIX-4020 fix the circular reference tests by detecting circular reference earlier and returning null immediately