Added more diagnostics and improved tests for YAML