Escape error messages

Escapes the error messages. Should be backported in my opinion @karlitschek