fix index, fix tests