Support reference uri & fix gobs of C code

Probably a good idea to document what these other two nulls are?