Fix appending of empty paths (the trailing slash was incorrectly overwritten).
Fix #2 for trailing slashes for REST client requests.