Fix newrelic ERB conversion, with tests.