More tests and fixes regarding escape characters