Fixing error when checking if module is defined.