bugfix: entity counter was not properly updated with nestable entities