Fix bug with terminating quotes with escaped quotes