Improved reliability of isPathWriteable(). Add slash to directories that don't end with one.