Fixed bug in sequence creation