Improve nonce calculation.