Cleanup around context.statement handling across versions