Fix out of bounds access when loading CTF/CTY