Fixing bad indexes