Fixes #38 some bugs in the resource visitor

* fixes an NPE
* fixes a bug with incorrectly ignoring resources that shouldn't be
ignored.  this is less efficient but more correct