Add spec and a few fixes for set_uri