Added EnumerateModules method and extra error reporting.