Modify is_directory check to support symlinks to directories. This fixes #146.