Non-existing modules check

- bugs fixed related to non-existing modules.