Fix flash bugs.