Small changes to GetManyByFieldPtr and added a test for it.