Fix for the obtaining modules in dependency order.