Create $WALLET_DIR, if necessary, before setting a key.
More consistent style.