Fix delete and index tests

The first two commits are just missing variables and renamed methods.

669c268 and daf7eae both fix the same issue, just at different places because I wasn't sure if the code in lib/ or in t/ was wrong.