More audits of the code

for the same problem as the last commit
Be more careful about decoding malformed attributes