fixed bugs in dataflow
tests are passing