bugfix: wrong counting for type-ref with null-items