Fix doc string selection

Previously it would pick the doc string for any function that matched
in name. Problematic when multiple classes have the same function names.