Failing spec for flow query
Spec passes
Clean up flow query logic.