diff --git a/trunk/fcl/include/fcl/shape/geometric_shape_to_BVH_model.h b/trunk/fcl/include/fcl/shape/geometric_shape_to_BVH_model.h
index 7a9f83f90998c6a4cad716f6e3090ef6352a1268..7d5421511d6ee36e41c7ee8cda7685aeb6cab4b1 100644
--- a/trunk/fcl/include/fcl/shape/geometric_shape_to_BVH_model.h
+++ b/trunk/fcl/include/fcl/shape/geometric_shape_to_BVH_model.h
@@ -298,7 +298,7 @@ void generateBVHModel(BVHModel<BV>& model, const Cone& shape, const Transform3f&
 
   for(unsigned int i = 0; i < tot; ++i)
   {
-    Triangle tmp(h_num * tot + 1, (h_num - 1) * tot + (i == tot - 1) ? 0 : (i + 1), (h_num - 1) * tot + i);
+    Triangle tmp(h_num * tot + 1, (h_num - 1) * tot + ((i == tot - 1) ? 0 : (i + 1)), (h_num - 1) * tot + i);
     tri_indices.push_back(tmp);
   }