Bug fixes, missing str and checking length of file opened with w mode.
Bug fixes, missing str and checking length of file opened with w
mode.

cmantas/tiramola_v3,cmantas/tiramola_v3,cmantas/tiramola_v3