bugfix: nitems needs to be incremented after accessing the actual item pointer