Fixed bugs in loading NS module.