Fix problem with writeToFile: and nil name
Merge branch 'fry-fix-error-crash' into doo_master
Improve file handling
Log error for directory creation
Better identation
Don't use deprecated method
Log error if file is not rceated