Deal properly with refunds

Closes #2 on github.