Minor fixes

I fixed the index counter
I added a better exception for the all 0 column special case