Fixed reading from the wrong array (#2)