fix some quoting and escaping