fix crash on regtest block generation / slightly simplify _if_ for testnet detection

2 small fixes, title says it all...