So sorry, I really shouldn't have left that check in the code, I only put it there to check that I gave a proper order to every ammo categories 'bonuses'. But if mods are going to define new ammo categories, I'm not going to try and guess what order they should have...
I've uploaded a new version of the mod that should load now without any errors, it instead just prints to the log file.
So if I could have your factorio-current.log after you usefully load my mod, I can see if there're other changes I should make.