Fix error if val is "" for some reason