Optimization of module_init (manual merge from ADA master)