Fix bug that caused all possible subsequences to be considered