Ensure that old dependencies are removed when regenerating modules