Fixed bugs in Index