Backport *Collection-ref fixes from develop branch