fix bug with withdrawals, make tests pass