fix wrong indexing in list and tree store