Feature/distance

1) fix bug in segment-box disjoint computation
2) fix compilation errors for distance and disjoint on darwin gcc 4.2.1 and msvc-12.0