Fix pattern validation