fixed bug in writeFile: isWritable fails if path doesn't exist

fixed messages of errors thrown in various places