Fixed computeDetectionProbability function.