Fixing empy index notices