Fix ScanDirectory to use scanOptions parameter.