Fix for document ObjectId comparison