Fixed awaiting for wrong tasks bug.