Fixed erase check in flash_write command
Added error checking to see if flash_write failed
Removed debug statement