fixed cast to Double. Fixed Console OptimizeNow feature. Other changes