Fix bug in error handling.

Fix a bug where tasks would not properly stop after a different
tasks has an error and --continue is not given.
Remove unused variable.