Fix OSX Bundle build
Cast to double since we return a double.
Forgot to initialize field optimization_distance2.
Merge branch 'master' into texture