Use the simpler is_directory.