Support nested task list

by handling nodes more correctly