Fixed sequence length bug