Rename doos done and error functions.

Also prevent variable collisions by renaming RESULT to ECHO_TAG.