Fix bug in excludeRegex handling.