Fix newly introduced bug with matching of partial names. (#508)