Changed saving of health units from the use of transactions to using flush()