Fix error in counting item length

Additional fix needed for handling non-array items in HAL data. Branches were not being counted properly when data was not wrapped in an array.