A few modifications for regtest mode