fixed type of returned value to Array, fixed tests