Fix name of self -> klass.

I must have reverted this change. Anyway, rename the variable to match the rest of
the similar API to klass and create a new instance of Repository.