Fixed escapeSteps algorithm to pass automarker asserts