Make the uri method take optional parts into account

Sammy did this.