Fixes to bugs in some flash algorithms.