Fixed another bug in determining the items currently visible (see #197)