General bug fixes when setting mail count on the module. Minor edc changes. Better cleanup when closing the module. SVN revision: 23396
patches. SVN revision: 23379