Fix backslash escaping, add tests