Fix formatting issue with entityId override as a collection; add tests for it