Adding write-string and error checking for hIsWritable.