More error checking

Sometimes it fails to decode a string. Try to figure out why.