FFix many wallet bugs.