Use assoc_array_to_table() in more places

See #703.

cc: @danielbachhuber