Building array from object of arrays returns undefined