Fixed failed download handling.
Improved search queue code.