Fix bug with empty array for populating arrays.