Only variables should be referenced in function.
Changed import logic if type is referat.
See if URI is empty.