Fixes returning wrong array