Fix listCmds() calling erase() on empty string