Few bug fixes, added Wallet

Did this ages ago, never synced it.
Final bugfix for 1.6.4