Changed yaml dumping to use safe_dump, for consistency with loading.
Fixed tsv auto format detection.