Fix exception caused by trying to decode string