Fixed a bug with very long sequences.