fixes memory leak and other issues with test_fasta