Issue #209: Cleaned up the enumerate_modules function a little bit.