Improve quoting to replicate CS's behavior more closely