Added escape/ensure logic.