[fix] Dont' allow duplicate listeners
[minor] Don't write if we have no content, but still flush.