Fixed minor bugs.
Run flash script in background.