Fix for bug #3022, allowing for mixing Object API and Graph/Document API...

Retrying pull request #3033