[FIX] Fixed empty index bugs.