Fixed an issue with GetFiles

Fixed an issue where GetFiles was always checking if the specific target
was a directory rather than the actual directory.