Bugfix for the current index handling.