Fixes to flash algorithms.