Support reference uri & fix gobs of C code

This looks like a warning? But there's exception handling right below it. Can you explain?