Infinite loop when only one post exists.

I noticed on the index method there is a while loop that will infinite loop if only one post exists. I am working on a solution, pull-request to follow.