Fixed looping bug to return the proper number of MembershipResult items
in the array (previously, the SQL query found too many entries, so it
needed to be further constrained).