Fix handling of empty output yaml file
Fix out of memory exception
Remove spurious debug print