fixed errors in URI construction while null