mempool: fix returned value after counting objects