Updated to preserve last SQLite db
Fixed column mismatch in log_download