Improved error catching on s3 task.
Refactored task & target iterators.