Fixed bug in orphanage.js when removing a very large number of orphaned documents.