Fix the read/write from/to YAML