Improve handling in yaml.rb.