Add set -e
Some fixes to task.