standardize indentation and make compatible with set -e