flow bugfixes