More robust yaml parsing