streams/ddt: fix some edge case bugs