Fixed a problem with isDir flag being uninitialised