Fixed duplicate key error in leg detection.