Fixed TWK-1454: Don't crash when trying to set invalid current index.