Fixed weirdness with encoding/decoding data