update file writing for CF point writer;
fix bug when writing structures