Normalize array index