Rework bash 3 compat and add color to errors.