Yes, that's right. The first sale is a wash sale, so the $1 loss is disallowed, but it is added to the basis of the replacement share. So the basis of the replacement share is the $8 that you paid for it plus the $1 disallowed loss from the wash sale, which is $9. You sold it for $9 so you have no gain or loss.