bugfix: properly handle partial refunds