Fixed several bugs with escape sequences.