Flash Repair.

Repaired flash function.