It seems that $as_echo is undefined on some systems. Fixed.