Fixed serious bug in es_append