Fix a bug in generation of seq