#12 add support for empty input in gather_array