Reverted to using grep for partial matching of var.stubs, but added code to strip out false matches due to overlaps in the matching where one var.stub is a subset of another.