Fix scrolling issue

  Items were not scrolling properly because the calculation of number of items was wrong.