Control array boundaries for DEX classes to fix #1541