Added test to cover output to file, fixed bug in formatting lineages.