Fixed bug when using the mail module across applications.