switch to YAML and fix two bugs