Fix YAML codec. Improve code.