Fix errors that occur when streams don't match cursors

- Update cursors when more streams than cursors and
  less streams then cursors.
- Added unit tests

#2024