Why are you using the local namespace here indirectly, why not just check against the local names directly?  If you have a good reason, that would make a nice comment, I'm sure others would have same question.