Fix for small bug in isDirectortWritable