Add appropriate tests and assertions for email output fix