tests and bugfix for next() method and nonsequential access use case