Fix pattern script