The first time the program is run, it creates a wallet.dat file that is written unencrypted to disk. Later encryption of this wallet file, may leave plaintext fragments on the storage device due to details of the operation of the filesystem or storage device. One workaround is to create the wallet.dat file on another system perhaps using a Live CD, encrypt it, and copy this encrypted wallet over to the desired system.
It would be better if the first time the program is run, it asks if the user wishes to encrypt their wallet, then asks for the passphrase, and from the start writes only the encrypted version to disk.