fixes bug where dict_to_arr incorrectly inferred the length of its output array