fixed escaping in parsing. fixed other bugs