Fix flash... and, in the process, clean up a bunch of stuff.