Fixed array bug where arrays were not being completely populated