Handle nullable types in JSON decoder, small optimizations.