Improve performance of chained tasks and avoid wrapping exceptions