Fix returned stream not ending after all target files had been handled.