Added filePattern argument.