fixes #6599

also small improvements to the loadout system

Signed-off-by: Mloc <colmohici@gmail.com>
Merge pull request #6611 from Mloc/bs12-overflow

fixes #6599