Use linked list for credentials too
Add a few fixes inspired by jow@openwrt.org