Fixed bug in echo functions