Not that I see any code actually testing ISDIR, much less appending if it's true.