Fixed bug for saving groups. Improved read and write group process.