Cleanup upgrade logic and use correct modName var