Fix little bugs after IDEA code analiz
Added modified write to csv