Hi,
you might have a correction routine somewhere else, but in control.lua there is this function:
function modulelevel()
return math.max((global.killcount / base)^(1/exponent) + 1, 1)
end
It returns the module level based on kill count, and if you kill enough enemies it will result in a module level 21 or higher. The mod only has 20 levels, so as soon as you hit the 21 the game will crash. I learned it while playing around with this and another mod.
This solves the issue:
function modulelevel()
return math.min(math.max((global.killcount / base)^(1/exponent) + 1, 1),20)
end