Revert "Revert "Fixed bugs""

This reverts commit 6e126a464db306c420634f1b602503ab459bfaf2.
Revert "Revert "Implement print tasks method for debugging""

This reverts commit 40590a428374882312708982da13b5baf723c6f2.