Fix a couple of quoting bugs

Needs more audit and tests