Fix walks when the prefix doesn't match any strings

Currently, the walk code doesn't check to see if any prefixes matching the
string actually exist.