Bugfixes
Optimize currentIndex