Fixing bugs in wallet