Fix a bug in the count and some problems with packing the view