Fix SEGFAULTs and broken error handling for flash programming w/working area