read_config: only pick first key for each key id
Fix bug with goodsig variable