Debug on

Little fix in viewer.
Some chmod added to reade file