Tracking down encoding/decoding bug.