Fix chunk size verification

Trying to access property of non-object, change to access property of array. Ensure chunk id is integer when retrieving from array.