Bugfixes on index