Fix bug with infinite loop when use $context in module constructor.