Fix bugs in collection table view and apply formatting

@nbonatsakis This should fix the issue you were having. I'm an idiot - I had a few comparison operators backwards. Surprised this actually worked in the other projects in which it was used (maybe they all only had one section).