Add debug flag and switch from run to task dependencies