Check if margin > 0, not if prob > 0.5

This avoids an unnecessary computation and also possible math overflow errors.