Fix undefined indexes in Tabs, Carousel