Fix an incorrect condition when creating list elements with TAB