The new RPC generatetoaddress didn't seem to work for me both from the command line and from the Qt debug window console.
This change makes it work for me.
For example, I kept getting similar to this (I tried various quoting etc... too):
./src/bitcoin-cli -regtest -datadir=/nodes/1 generatetoaddress 1 mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a
error: Error parsing JSON:mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a
Reference: #7671
