Fix initial password setup and prevent idempotency issues