[Issue 62] Test change of scope during ref resolution

The closest parent "id" must be used to resolve refs.