More fixes on matching the standard library.

According to the specs: "Pointer values encode as the value pointed to. A nil pointer encodes as the null JSON object."