deposit: several fixes