Improve resource path registration

We cannot rely upon $IP to determine path.