table_to_ndarray: fix bug