Fix KeyValue key_pattern validation