Fixes #3619 - better parsing and escaping values
Merge pull request #38 from ares/bug/3619

Fixes #3619 - better parsing and escaping values