path.getfilename will never return null unless you pass null, which we don't do setchecksums' base method does the AllBlocks.SetChecksums. move the battle team set to right before the usage of SetChecksums
if x is y with z property true, then :D
Move some logic around to the more appropriate spot