Fix pattern match