Fix module instance check