Name resolution should respect %hide

Fixes #573