Fix ResourceManagerId assignment
Make sure documentStore.ResourceManagerId is always set when we create the docstore