More fixes esp. in reading/writing persistent data
Fixed a memory leak