Module handling bug fixed.(double loading)
Closed resources removed.
Substitution mechanism improved.