Fix module counting and race condition bugs.
Authored by: gowdy 2001-01-16
Parent: [r838]
Child: [r840]