Fix incorrect URL creation for document loading