Added saving of changes after exporting to db
Fixed write to file by swapping empty points collection with null, fixed references accordingly