Use int instead of short for local index.