Fixed a bug by which the debug unit (core files) was being closed too early in inversion mode so that if an error occurred during the last synthesis, the code would not be able to write the debug info and crash