replace undefined by uninitialized
add comments
add a rationale for developers
fix ndemanded in waitTasks()