Re-enable set -e; replace "((" commands with "$((" expressions