Move code around a bit.
Wrap line.
Cleanup and fixes that make everything work.

The tasks are now run as expected and execution stops when all tasks
have been run.