Improvements to ECHO to better handle whitespace and character escaping