Encode empty paths correctly #730