Bugfix in parsing escaped characters (+ additional tests to prevent this bug in future).

Thanks to Joseph Werle for bringing attention to it.