Code review: Consolidate code that adds trailing slashes; make empty-string
behavior more explicit