Improved handling of single quotes in literal values