Fix world encoding/decoding.