Fixed a bug with pagination of categories.

If the category was the first element on a page, an extra page break was inserted.