Fixed bug in flush that lead to 1 value writes.