fixed segmentation fault if there are modules running.
Authored by: dkroker 2014-04-29
Parent: [r2236]
Child: [r2238]