Better statistics flushing

Beta 0.3