bugfix and fix flapper tests