Fix bug with downloading files ending with slash