Fixed topological sorting of tasks, simplified signatures