fixed compile errors on MSVC and make maxSubSteps constant