Fixed isDirectoryWritable so that it's functional in Windows environments.