Fix broken topic recounting on unpublished topics

May fix longstanding bug #1367 at least the bug description fits to the issue I fixed.