Added handling for escaped characters