rewrite fixes, mailcatcher fixes