Upgrading from Bitcoin

- setgenerate creates multiple blocks in -regtest mode.
- Fix uninitialized variable