FsmDetectorTest: Improved tree balancing