Fix some bugs in the moderation logic and emails