Fix encoding error caused when constructing command to download a stream
Tweak handling of seen database file