Fix last visit finding code.

This was broken when we changed visit types. We really need to get away from all of this string matching and rely on constants or something the runtime can catch for us.