LPS-43567 Cleanup missing references

Hey Brian,

This is the master fix of the 6.2.x version what you have merged already. It comes with the related test as well.

The test I'm going to backport now, and send a separate pull request to you with that in it.

Thanks,

Máté