Fix bug where new sequence not written out