Fix warning on setRootIndex