Fix directory scanning using the new NSURLKeys

There was confusion over using the keys and the similarly named (but now-unused) variables
E.g. URLIsDirectory vs. NSURLIsDirectoryKey