FIx checking whether the topic is in internal `_map`.
Add test codes.