Properly handle NULL URIs.

Copied from the Firebird engine, but applies to them all.