Fixed custom gamma

I was getting odd results with the clever algorithm (possibly due to uninitialized `i`).