Fixed: in certain cases (replication), doc could be undefined resulting to a crash of the application
Merge pull request #79 from jsilvestre/fix

Fixed: in certain cases (replication), doc could be undefined resulting ...