Fix $ref handling so it'll work with URIs that have a fragment identifier
as their last character
Fix  handling so it'll work with URIs that have a fragment identifier
as their last character