Updating closing logic of flash unit
fixing flash_unit typos
Bug fix: flash unit argument order
Adding flash unit tests