Script: Add support for longer codes, fix exception when DisplayName > 16