Fix spki_table_get_all element chaining and err handling